home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: Rich Paul <rpaul@trcinc.com>
- Newsgroups: comp.std.c++
- Subject: Re: static members as members of a metaclass h
- Date: 10 Apr 1996 14:56:46 GMT
- Organization: Technical Resource Connection
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <316BC211.1B39@trcinc.com>
- References: <4jc5lt$doh@arl-news-svc-2.compuserve.com>
- <4jckdc$ad6@engnews1.Eng.Sun.COM> <kywx3q1nox.fsf@gator.mit.edu>
- NNTP-Posting-Host: taumet.eng.sun.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset="us-ascii"
- Content-Transfer-Encoding: 7bit
- X-Nntp-Posting-Host: bajor-le1.trcinc.com
- X-Mailer: Mozilla 2.01Gold (WinNT; I)
- X-Lines: 22
- Content-Length: 735
- Originator: clamage@taumet
-
- Jeffrey C. Gealow wrote:
- >
- > In article <4jckdc$ad6@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM
- > (Steve Clamage) writes:
- >
- > I believe a reasonable solution to the problem of initialization of
- > non-local static data is not to use non-local static data!
- >
- > Instead of a static data object or static class data member, use a
- > function with a local static object.
- >
- > But this adds the overhead of the function call mechanism to every use
- > of the object.
- >
-
- If you inline the function, are you guarenteed a
- single instance, or might there be one in each
- compilation unit, or in each invocation of the
- function?
-
- If it's safe, inlining the function would get rid
- of the overhead, but I'm not sure of the safety ...
-
-
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-